home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gui4cli / tools / rtn / filepop < prev    next >
Text File  |  1999-04-29  |  3KB  |  139 lines

  1. G4C
  2.  
  3. ; Opens pop-up window to deal with a file
  4.  
  5. ; USE:
  6. ; GuiLoad guis:tools/rtn/FilePop FileName    -or
  7. ; GuiOpen FilePop FileName
  8.  
  9. ; ================================================================
  10.  
  11. ;             Globals & system events
  12.  
  13. ; ================================================================
  14.  
  15. WinBig 0 0 80 90 ""
  16. WinType 00001000
  17. winonmouse 30 7 
  18.  
  19. xonload filename
  20. if $filename > ''
  21.    guiopen FilePop $filename
  22. endif
  23.  
  24. xonreload filename
  25. if $filename > ''
  26.    guiopen FilePop $filename
  27. endif
  28.  
  29. xonopen filename  ; just to get the var
  30.  
  31. xOnRMB 
  32. guiclose FilePop
  33.  
  34. xOnInactive
  35. guiclose FilePop
  36.  
  37. xOnFail
  38. ezreq "Error during operation" OK ""
  39.  
  40. xOnQuit
  41. guiquit FilePop2
  42.  
  43. ; ================================================================
  44.  
  45. ;             Buttons
  46.  
  47. ; ================================================================
  48.  
  49. xbutton 0 0 0 15 Auto
  50. guiclose FilePop
  51. guiload guis:tools/rtn/GetFileType $filepop/filename
  52. filetype = $$ret.0
  53. if $filetype > ''
  54.    guiload guis:tools/rtn/ViewFile $FilePop/filename $FilePop/filetype RUN
  55. endif
  56.  
  57. xbutton 0 15 0 15 More..
  58. guiopen  FilePop2
  59. guiclose FilePop
  60.  
  61. xbutton 0 30 0 15 List
  62. guiload guis:tools/read.gc $FilePop/filename
  63.  
  64. xbutton 0 45 0 15 Cli..
  65. guiclose FilePop
  66. guiload guis:tools/cli.gc $filepop/filename CLI
  67.  
  68. xbutton 0 60 0 15 'Edit'
  69. ifexists port rexx_ced        ; if the CygnusEd editor is running..
  70.    ifexists gui cedbar.gc    ; use it for the editing
  71.        guiscreen cedbar.gc front
  72.    else
  73.        guiscreen FilePop back    ; hoping that Ced is the next screen..
  74.    endif
  75.    sendrexx rexx_ced 'open new'
  76.    sendrexx rexx_ced 'open $filename'
  77.    sendrexx rexx_ced 'expand view'
  78. elseifexists variable *DEF.EDITOR
  79.    run '$*DEF.EDITOR $filename'
  80. else
  81.    run 'c:ed $filename'
  82. endif
  83. guiclose FilePop
  84.  
  85. xbutton 0 75 0 15 Rx
  86. guiclose FilePop
  87. sendrexx AREXX '$filename'
  88.  
  89.  
  90. ;######################################################################
  91.  
  92.     NEWFILE FilePop2    ; Pop-up on double-click "More.." gui.
  93.                 ; edit this gui to fit your favourites
  94.  
  95. ;######################################################################
  96.  
  97. WinBig 0 0 80 90 ""
  98. WinType 00001000
  99. winonmouse 30 7 
  100. varpath 'FilePop'
  101.  
  102. xOnRMB 
  103. guiclose FilePop2
  104.  
  105. xOnInactive
  106. guiclose FilePop2
  107.  
  108. xOnFail
  109. ezreq "Error during operation" OK ""
  110.  
  111. ;---------------> the Buttons
  112.  
  113. xbutton 0 0 0 15 'MView'
  114. guiclose FilePop2
  115. if $*DEF.DT > ''
  116.    run '$*DEF.DT $filename'
  117. else
  118.    run 'multiview $filename'
  119. endif
  120.  
  121. xbutton 0 15 0 15 'FRead'
  122. guiclose FilePop2
  123. *FRGUIDE = $filename
  124. guiload guis:tools/fastread/fastread.gc
  125.  
  126. xbutton 0 30 0 15 'DPaint'
  127. guiclose FilePop2
  128. run '$*DEF.PAINT $filename'
  129.  
  130. xbutton 0 45 0 15 'GfxEd'
  131. run '$*DEF.GFXED $filename'
  132.  
  133. xbutton 0 60 0 15 'HexView'
  134. run '$*DEF.HEX $filename'
  135.  
  136. xbutton 0 75 0 15 'Mod'
  137. run '$*DEF.MOD $filename'
  138.  
  139.